package com.project.webpage.controller;


import com.github.pagehelper.PageInfo;
import com.project.webpage.aop.TagLog;
import com.project.webpage.dto.GpsPcBcParam;
import com.project.webpage.dto.SearchByRqParam;
import com.project.webpage.dto.ShPjsdParam;
import com.project.webpage.dto.ShZzParam;
import com.project.webpage.service.XlbcGpsService;
import com.project.webpage.util.RestResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/webpage/xlbcgps/")
public class XlbcGpsController extends BaseController {

    @Resource
    XlbcGpsService xlbcGpsService;

    /**
     * 线路实时车辆班次供应列表查询
     */
    @PostMapping("bc/page")
    @TagLog(operation = 0, content = "查询线路实时车辆班次供应列表")
    public RestResult bcPage(@RequestBody SearchByRqParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(xlbcGpsService.getListForPage(param)));
    }

    /**
     * 导出线路实时车辆班次供应列表
     */
    @PostMapping("bc/output")
    @TagLog(operation = 5, content = "导出线路实时车辆班次供应列表")
    public RestResult bcOutput(@RequestBody SearchByRqParam param) {
        this.getPage(false, param);
        return RestResult.ok(xlbcGpsService.getListForPage(param));
    }


    /**
     * 线路实时车辆班次供应按企业列表查询
     */
    @PostMapping("bc/qy/page")
    @TagLog(operation = 0, content = "查询线路实时车辆班次供应按企业列表")
    public RestResult bcQyPage(@RequestBody SearchByRqParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(xlbcGpsService.getQyListForPage(param)));
    }

    /**
     * 导出线路实时车辆班次按企业供应列表
     */
    @PostMapping("bc/qy/output")
    @TagLog(operation = 5, content = "导出线路实时车辆班次供应按企业列表")
    public RestResult bcQyOutput(@RequestBody SearchByRqParam param) {
        this.getPage(false, param);
        return RestResult.ok(xlbcGpsService.getQyListForPage(param));
    }

    /**
     * 线路实时车辆供应列表查询
     */
    @PostMapping("pc/page")
    @TagLog(operation = 0, content = "查询线路实时车辆供应列表")
    public RestResult pcPage(@RequestBody SearchByRqParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(xlbcGpsService.getPcListForPage(param)));
    }

    /**
     * 导出线路实时车辆供应列表
     */
    @PostMapping("pc/output")
    @TagLog(operation = 5, content = "导出线路实时车辆供应列表")
    public RestResult pcOutput(@RequestBody SearchByRqParam param) {
        this.getPage(false, param);
        return RestResult.ok(xlbcGpsService.getPcListForPage(param));
    }

    /**
     * 线路实时车辆供应按企业列表查询
     */
    @PostMapping("pc/qy/page")
    @TagLog(operation = 0, content = "查询线路实时车辆供应按企业列表")
    public RestResult pcQyPage(@RequestBody SearchByRqParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(xlbcGpsService.getPcQyListForPage(param)));
    }

    /**
     * 导出线路实时车辆供应按企业列表
     */
    @PostMapping("pc/qy/output")
    @TagLog(operation = 5, content = "导出线路实时车辆供应按企业列表")
    public RestResult pcQyOutput(@RequestBody SearchByRqParam param) {
        this.getPage(false, param);
        return RestResult.ok(xlbcGpsService.getPcQyListForPage(param));
    }

    /**
     * 线路实时车辆供应指定线路配车列表查询
     */
    @PostMapping("pc/jgxlid/page")
    @TagLog(operation = 0, content = "查询线路实时车辆供应指定线路配车列表")
    public RestResult pcJgxlidPage(@RequestBody SearchByRqParam param) {
        this.getPage(false, param);
        return RestResult.ok(xlbcGpsService.getPcCphListForPage(param));
    }

    /**
     * 线路实时平均速度列表查询
     */
    @PostMapping("pjsd/page")
    @TagLog(operation = 0, content = "查询线路实时平均速度列表")
    public RestResult pjsdPage(@RequestBody ShPjsdParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(xlbcGpsService.getPjsdListForPage(param)));
    }

    /**
     * 导出线路实时平均速度列表
     */
    @PostMapping("pjsd/output")
    @TagLog(operation = 5, content = "导出线路实时平均速度列表")
    public RestResult pjsdOutput(@RequestBody ShPjsdParam param) {
        this.getPage(false, param);
        return RestResult.ok(xlbcGpsService.getPjsdListForPage(param));
    }

    /**
     * 线路实时滞站报警列表查询
     */
    @PostMapping("zz/page")
    @TagLog(operation = 0, content = "查询线路实时滞站报警列表")
    public RestResult zzPage(@RequestBody ShZzParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(xlbcGpsService.getZzListForPage(param)));
    }

    /**
     * 导出线路实时滞站报警列表
     */
    @PostMapping("zz/output")
    @TagLog(operation = 5, content = "导出线路实时滞站报警列表")
    public RestResult zzOutput(@RequestBody ShZzParam param) {
        this.getPage(false, param);
        return RestResult.ok(xlbcGpsService.getZzListForPage(param));
    }

    /**
     * 指定线路出车数详细列表查询
     */
    @PostMapping("gpspc/jgxlid/detail")
    @TagLog(operation = 0, content = "查询指定线路出车数详细列表")
    public RestResult gpsPcDetailByJgxlid(@RequestBody GpsPcBcParam param) {
        this.getPage(false, param);
        return RestResult.ok(xlbcGpsService.getGpsPcListForPage(param));
    }

    /**
     * 指定线路班次数详细列表查询
     */
    @PostMapping("gpsbc/jgxlid/detail")
    @TagLog(operation = 0, content = "查询指定线路班次数详细列表")
    public RestResult gpsBcDetailByJgxlid(@RequestBody GpsPcBcParam param) {
        this.getPage(false, param);
        return RestResult.ok(xlbcGpsService.getGpsBcListForPage(param));
    }
}
